//
//  JKProgressImageView.swift
//  JKProgressView
//
//  Created by albert on 16/6/24.
//  Copyright © 2016年 albert. All rights reserved.
//

import UIKit

class JKProgressImageView: UIImageView {

    /** 进度 */
    var progress: CGFloat = 0 {
        didSet{
            progressView.progress = progress
        }
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }
    
    /** 初始化 */
    private func setupUI() {
        addSubview(progressView)
        progressView.backgroundColor = UIColor.clearColor()
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        progressView.frame = bounds
    }
    
    /** progressView */
    private lazy var progressView: JKProgressView = JKProgressView()
}
